
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>（三）服务器 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../版本历史.html" />
    
    
    <link rel="prev" href="二方库依赖.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    一、编程规约
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../编程规约/命名风格.html">
            
                <a href="../编程规约/命名风格.html">
            
                    
                    （一）命名风格
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../编程规约/常量定义.html">
            
                <a href="../编程规约/常量定义.html">
            
                    
                    （二）常量定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../编程规约/代码格式.html">
            
                <a href="../编程规约/代码格式.html">
            
                    
                    （三）代码格式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../编程规约/OOP规范.html">
            
                <a href="../编程规约/OOP规范.html">
            
                    
                    （四）OOP规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../编程规约/集合处理.html">
            
                <a href="../编程规约/集合处理.html">
            
                    
                    （五）集合处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../编程规约/并发处理.html">
            
                <a href="../编程规约/并发处理.html">
            
                    
                    （六）并发处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="../编程规约/控制语句.html">
            
                <a href="../编程规约/控制语句.html">
            
                    
                    （七）控制语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="../编程规约/注释规约.html">
            
                <a href="../编程规约/注释规约.html">
            
                    
                    （八）注释规约
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    二、异常日志
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../异常日志/异常处理.html">
            
                <a href="../异常日志/异常处理.html">
            
                    
                    （一）异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../异常日志/日志规约.html">
            
                <a href="../异常日志/日志规约.html">
            
                    
                    （二）日志规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../异常日志/其他.html">
            
                <a href="../异常日志/其他.html">
            
                    
                    （三）其他
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../单元测试.html">
            
                <a href="../单元测试.html">
            
                    
                    三、单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../安全规约.html">
            
                <a href="../安全规约.html">
            
                    
                    四、安全规约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    五、MySQL数据库
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../MySQL数据库/建表规约.html">
            
                <a href="../MySQL数据库/建表规约.html">
            
                    
                    （一）建表规约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../MySQL数据库/索引规约.html">
            
                <a href="../MySQL数据库/索引规约.html">
            
                    
                    （二）索引规约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../MySQL数据库/SQL语句.html">
            
                <a href="../MySQL数据库/SQL语句.html">
            
                    
                    （三）SQL语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../MySQL数据库/ORM映射.html">
            
                <a href="../MySQL数据库/ORM映射.html">
            
                    
                    （四）ORM映射
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <span>
            
                    
                    六、工程结构
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="应用分层.html">
            
                <a href="应用分层.html">
            
                    
                    （一）应用分层
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="二方库依赖.html">
            
                <a href="二方库依赖.html">
            
                    
                    （二）二方库依赖
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.7.3" data-path="服务器.html">
            
                <a href="服务器.html">
            
                    
                    （三）服务器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../版本历史.html">
            
                <a href="../版本历史.html">
            
                    
                    附1：版本历史 
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../本手册专有名词.html">
            
                <a href="../本手册专有名词.html">
            
                    
                    附2：本手册专有名词 
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >（三）服务器</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x4E09;-&#x670D;&#x52A1;&#x5668;">(&#x4E09;) &#x670D;&#x52A1;&#x5668;</h2>
<ol>
<li>&#x3010;&#x63A8;&#x8350;&#x3011;&#x9AD8;&#x5E76;&#x53D1;&#x670D;&#x52A1;&#x5668;&#x5EFA;&#x8BAE;&#x8C03;&#x5C0F;TCP&#x534F;&#x8BAE;&#x7684;<code>time_wait</code>&#x8D85;&#x65F6;&#x65F6;&#x95F4;&#x3002; &#x8BF4;&#x660E;&#xFF1A;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x9ED8;&#x8BA4;240&#x79D2;&#x540E;&#xFF0C;&#x624D;&#x4F1A;&#x5173;&#x95ED;&#x5904;&#x4E8E;<code>time_wait</code>&#x72B6;&#x6001;&#x7684;&#x8FDE;&#x63A5;&#xFF0C;&#x5728;&#x9AD8;&#x5E76;&#x53D1;&#x8BBF;&#x95EE;&#x4E0B;&#xFF0C;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x4F1A;&#x56E0;&#x4E3A;&#x5904;&#x4E8E;<code>time_wait</code>&#x7684;&#x8FDE;&#x63A5;&#x6570;&#x592A;&#x591A;&#xFF0C;&#x53EF;&#x80FD;&#x65E0;&#x6CD5;&#x5EFA;&#x7ACB;&#x65B0;&#x7684;&#x8FDE;&#x63A5;&#xFF0C;&#x6240;&#x4EE5;&#x9700;&#x8981;&#x5728;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x8C03;&#x5C0F;&#x6B64;&#x7B49;&#x5F85;&#x503C;&#x3002; 
<br><span style="color:green">&#x6B63;&#x4F8B;</span>&#xFF1A;&#x5728;linux&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x8BF7;&#x901A;&#x8FC7;&#x53D8;&#x66F4;/etc/sysctl.conf&#x6587;&#x4EF6;&#x53BB;&#x4FEE;&#x6539;&#x8BE5;&#x7F3A;&#x7701;&#x503C;&#xFF08;&#x79D2;&#xFF09;&#xFF1A;<pre class="language-">net.ipv4.tcp_fin_timeout = 30</pre></li>
<li>&#x3010;&#x63A8;&#x8350;&#x3011;&#x8C03;&#x5927;&#x670D;&#x52A1;&#x5668;&#x6240;&#x652F;&#x6301;&#x7684;&#x6700;&#x5927;&#x6587;&#x4EF6;&#x53E5;&#x67C4;&#x6570;&#xFF08;File Descriptor&#xFF0C;&#x7B80;&#x5199;&#x4E3A;fd&#xFF09;&#x3002; 
<br><span style="color:orange">&#x8BF4;&#x660E;</span>&#xFF1A;&#x4E3B;&#x6D41;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7684;&#x8BBE;&#x8BA1;&#x662F;&#x5C06;TCP/UDP&#x8FDE;&#x63A5;&#x91C7;&#x7528;&#x4E0E;&#x6587;&#x4EF6;&#x4E00;&#x6837;&#x7684;&#x65B9;&#x5F0F;&#x53BB;&#x7BA1;&#x7406;&#xFF0C;&#x5373;&#x4E00;&#x4E2A;&#x8FDE;&#x63A5;&#x5BF9;&#x5E94;&#x4E8E;&#x4E00;&#x4E2A;fd&#x3002;&#x4E3B;&#x6D41;&#x7684;linux&#x670D;&#x52A1;&#x5668;&#x9ED8;&#x8BA4;&#x6240;&#x652F;&#x6301;&#x6700;&#x5927;fd&#x6570;&#x91CF;&#x4E3A;1024&#xFF0C;&#x5F53;&#x5E76;&#x53D1;&#x8FDE;&#x63A5;&#x6570;&#x5F88;&#x5927;&#x65F6;&#x5F88;
&#x5BB9;&#x6613;&#x56E0;&#x4E3A;fd&#x4E0D;&#x8DB3;&#x800C;&#x51FA;&#x73B0;&#x201C;open too many files&#x201D;&#x9519;&#x8BEF;&#xFF0C;&#x5BFC;&#x81F4;&#x65B0;&#x7684;&#x8FDE;&#x63A5;&#x65E0;&#x6CD5;&#x5EFA;&#x7ACB;&#x3002; &#x5EFA;&#x8BAE;&#x5C06;linux&#x670D;&#x52A1;&#x5668;&#x6240;&#x652F;&#x6301;&#x7684;&#x6700;&#x5927;&#x53E5;&#x67C4;&#x6570;&#x8C03;&#x9AD8;&#x6570;&#x500D;&#xFF08;&#x4E0E;&#x670D;&#x52A1;&#x5668;&#x7684;&#x5185;&#x5B58;&#x6570;&#x91CF;&#x76F8;&#x5173;&#xFF09;&#x3002; </li>
<li>&#x3010;&#x63A8;&#x8350;&#x3011;&#x7ED9;JVM&#x8BBE;&#x7F6E;-XX:+HeapDumpOnOutOfMemoryError&#x53C2;&#x6570;&#xFF0C;&#x8BA9;JVM&#x78B0;&#x5230;OOM&#x573A;&#x666F;&#x65F6;&#x8F93;&#x51FA;dump&#x4FE1;&#x606F;&#x3002; 
<br><span style="color:orange">&#x8BF4;&#x660E;</span>&#xFF1A;OOM&#x7684;&#x53D1;&#x751F;&#x662F;&#x6709;&#x6982;&#x7387;&#x7684;&#xFF0C;&#x751A;&#x81F3;&#x6709;&#x89C4;&#x5F8B;&#x5730;&#x76F8;&#x9694;&#x6570;&#x6708;&#x624D;&#x51FA;&#x73B0;&#x4E00;&#x4F8B;&#xFF0C;&#x51FA;&#x73B0;&#x65F6;&#x7684;&#x73B0;&#x573A;&#x4FE1;&#x606F;&#x5BF9;&#x67E5;&#x9519;&#x975E;&#x5E38;&#x6709;&#x4EF7;&#x503C;&#x3002; </li>
<li>&#x3010;&#x63A8;&#x8350;&#x3011;&#x5728;&#x7EBF;&#x4E0A;&#x751F;&#x4EA7;&#x73AF;&#x5883;&#xFF0C;JVM&#x7684;Xms&#x548C;Xmx&#x8BBE;&#x7F6E;&#x4E00;&#x6837;&#x5927;&#x5C0F;&#x7684;&#x5185;&#x5B58;&#x5BB9;&#x91CF;&#xFF0C;&#x907F;&#x514D;&#x5728;GC &#x540E;&#x8C03;&#x6574;&#x5806;&#x5927;&#x5C0F;&#x5E26;&#x6765;&#x7684;&#x538B;&#x529B;&#x3002; </li>
<li>&#x3010;&#x53C2;&#x8003;&#x3011;&#x670D;&#x52A1;&#x5668;&#x5185;&#x90E8;&#x91CD;&#x5B9A;&#x5411;&#x4F7F;&#x7528;forward&#xFF1B;&#x5916;&#x90E8;&#x91CD;&#x5B9A;&#x5411;&#x5730;&#x5740;&#x4F7F;&#x7528;URL&#x62FC;&#x88C5;&#x5DE5;&#x5177;&#x7C7B;&#x6765;&#x751F;&#x6210;&#xFF0C;&#x5426;&#x5219;&#x4F1A;&#x5E26;&#x6765;URL&#x7EF4;&#x62A4;&#x4E0D;&#x4E00;&#x81F4;&#x7684;&#x95EE;&#x9898;&#x548C;&#x6F5C;&#x5728;&#x7684;&#x5B89;&#x5168;&#x98CE;&#x9669;&#x3002; </li>
</ol>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="二方库依赖.html" class="navigation navigation-prev " aria-label="Previous page: （二）二方库依赖">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../版本历史.html" class="navigation navigation-next " aria-label="Next page: 附1：版本历史 ">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"（三）服务器","level":"1.7.3","depth":2,"next":{"title":"附1：版本历史 ","level":"1.8","depth":1,"path":"版本历史.md","ref":"版本历史.md","articles":[]},"previous":{"title":"（二）二方库依赖","level":"1.7.2","depth":2,"path":"工程结构/二方库依赖.md","ref":"工程结构/二方库依赖.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["book-summary-scroll-position-saver","github","prism","-sharing","-highlight"],"pluginsConfig":{"github":{"url":"https://github.com/alibaba/p3c"},"book-summary-scroll-position-saver":{},"prism":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css"}},"file":{"path":"工程结构/服务器.md","mtime":"2018-01-13T07:52:52.584Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-01-15T14:41:43.583Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-book-summary-scroll-position-saver/book-summary-scroll-position-saver.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

